// eslint-disable-next-line
import {
	UserLayout,
	BasicLayout,
	BlankLayout
} from '@/layouts'
import {
	bxAnaalyse
} from '@/core/icons'

const RouteView = {
	name: 'RouteView',
	render: h => h('router-view')
}

export const asyncRouterMap = [{
		path: '/',
		name: 'index',
		component: BasicLayout,
		meta: {
			title: 'Home'
		},
		redirect: '/dashboard/analysis',
		children: [{
				path: '/dashboard',
				name: 'dashboard',
				redirect: '/dashboard/analysis',
				component: RouteView,
				meta: {
					title: '统计管理',
					keepAlive: true,
					icon: 'pie-chart',
				},
				children: [{
					path: '/dashboard/analysis/:pageNo([1-9]\\d*)?',
					name: 'Analysis',
					component: () => import('@/views/dashboard/Analysis'),
					meta: {
						title: '统计',
						keepAlive: false,
					}
				}]
			},
			{
				path: '/hospital',
				name: 'hospital',
				component: () => import('@/views/hospital/index'),
				meta: {
					title: '医院列表',
					keepAlive: true,
					icon: 'bank',
				},
			},
			{
				path: '/doctor',
				name: 'doctor',
				component: () => import('@/views/doctor/index'),
				meta: {
					title: '医生列表',
					keepAlive: true,
					icon: 'team',
				}
			},
			{
				path: '/doctorDetail',
				name: 'doctorDetail',
				hidden: true,
				component: () => import('@/views/doctor/detail'),
				meta: {
					title: '医生详情',
					icon: 'team',
					hidden: true,
				}
			},
			{
				path: '/pharmacy',
				name: 'pharmacy',
				component: () => import('@/views/pharmacy/index'),
				meta: {
					title: '药房列表',
					keepAlive: true,
					icon: 'bank',
				},
			},
			{
				path: '/medicineManage',
				name: 'medicineManage',
				redirect: '/medicine/category/index',
				component: RouteView,
				meta: {
					title: '药物管理',
					keepAlive: true,
					icon: 'profile',
				},
				children: [{
						path: '/medicineCategory',
						name: 'medicineCategory',
						component: () => import('@/views/medicine/category/index'),
						meta: {
							title: '药物分类',
							keepAlive: false,
						}
					},
					{
						path: '/chineseMedicine',
						name: 'chineseMedicine',
						component: () => import('@/views/medicine/chineseMedicine/index'),
						meta: {
							title: '中药',
							keepAlive: false,
						}
					},
					{
						path: '/westernMedicine',
						name: 'westernMedicine',
						component: () => import('@/views/medicine/westernMedicine/index'),
						meta: {
							title: '西药',
							keepAlive: false,
						}
					},
				]
			},
			{
				path: '/yaofang',
				name: 'yaofang',
				component: () => import('@/views/yaofang/index'),
				meta: {
					title: '药方管理',
					keepAlive: true,
					icon: 'team',
				},
			},
			// {
			//   path: '/orderManage',
			//   name: 'orderManage',
			//   redirect: '/orderManage/OrderList',
			//   component: RouteView,
			//   meta: {
			//     title: '订单管理',
			//     keepAlive: true,
			//     icon: 'ordered-list',
			//   },
			//   children: [{
			//     path: '/orderManage/OrderList',
			//     name: 'OrderList',
			//     component: () => import('@/views/orderManage/OrderList'),
			//     meta: {
			//       title: '商品订单列表',
			//       keepAlive: false,
			//     }
			//   }]
			// },

			{
				path: '/patientList',
				name: 'patientList',
				component: () => import('@/views/patient/index'),
				meta: {
					title: '患者列表',
					keepAlive: true,
					icon: 'team',
				},
			},
			// {
			//   path: '/orderList',
			//   name: 'orderList',
			//   component: () => import('@/views/order/list'),
			//   meta: {
			//     title: '订单列表',
			//     keepAlive: true,
			//     icon: 'team',
			//   },
			// },
			{
				path: '/orderManage',
				name: 'orderManage',
				redirect: '/order/list',
				component: RouteView,
				meta: {
					title: '订单管理',
					keepAlive: true,
					icon: 'ordered-list',
				},
				children: [{
						path: '/orderList',
						name: 'orderList',
						component: () => import('@/views/order/list'),
						meta: {
							title: '商品订单',
							keepAlive: true,
							icon: 'team',
						},
					},
					{
						path: '/zhongyaoOrderList',
						name: 'zhongyaoOrderList',
						component: () => import('@/views/order/zhongyao/index'),
						meta: {
							title: '中药处方订单',
							keepAlive: true,
							icon: 'team',
						},
					},
					{
						path: '/zhongyaoOrderListDetail',
						name: 'zhongyaoOrderListDetail',
						component: () => import('@/views/order/zhongyao/detail'),
						hidden: true,
						meta: {
							title: '中药处方订单详情',
							keepAlive: true,
							icon: 'team',
						},
					},
					{
						path: '/xiyaoOrderList',
						name: 'xiyaoOrderList',
						component: () => import('@/views/order/xiyao/index'),
						meta: {
							title: '西药处方订单',
							keepAlive: true,
							icon: 'team',
						},
					},
					{
						path: '/xiyaoOrderListDetail',
						name: 'xiyaoOrderListDetail',
						component: () => import('@/views/order/xiyao/detail'),
						hidden: true,
						meta: {
							title: '西药处方订单详情',
							keepAlive: true,
							icon: 'team',
						},
					}
				]
			},
			{
				path: '/goodsManage',
				name: 'goodsManage',
				redirect: '/goodsManage/goods/list',
				component: RouteView,
				meta: {
					title: '商品管理',
					keepAlive: true,
					icon: 'ordered-list',
				},
				children: [{
						path: '/goodsManage/goodsType/list',
						name: 'goodsTypeList',
						component: () => import('@/views/goodsManage/goodsType/list'),
						meta: {
							title: '商品分类',
							keepAlive: false,
						}
					},
					{
						path: '/goodsManage/goods/list',
						name: 'goodsList',
						component: () => import('@/views/goodsManage/goods/list'),
						meta: {
							title: '商品列表',
							keepAlive: false,
						}
					}
				]
			},
			{
				path: '/withDraw',
				name: 'withDraw',
				component: () => import('@/views/wallet/withDraw'),
				meta: {
					title: '提现管理',
					keepAlive: true,
					icon: 'team',
				},
			},
			{
				path: '/salesperson',
				name: 'salesperson',
				component: () => import('@/views/salesperson/index'),
				meta: {
					title: '销售列表',
					keepAlive: true,
					icon: 'team',
				},
			},
			{
				path: '/question',
				name: 'question',
				component: () => import('@/views/question/list'),
				meta: {
					title: '常见问题',
					keepAlive: true,
					icon: 'team',
				},
			},
			{
				path: '/newsManage',
				name: 'newsManage',
				component: () => import('@/views/news/index'),
				meta: {
					title: '科普文章',
					keepAlive: true,
					icon: 'team',
				},
			},
			// {
			//   path: '/bannerList',
			//   name: 'bannerList',
			//   component: () => import('@/views/banner/list'),
			//   meta: {
			//     title: '轮播图',
			//     keepAlive: true,
			//     icon: 'ordered-list',
			//   },
			// },

			// {
			//   path: '/couponList',
			//   name: 'couponList',
			//   component: () => import('@/views/coupon/index'),
			//   meta: {
			//     title: '平台优惠券',
			//     keepAlive: true,
			//     icon: 'ordered-list',
			//   },
			// },
		]
	},
	{
		path: '*',
		redirect: '/404',
		hidden: true
	}
]

/**
 * 基础路由
 * @type { *[] }
 */
export const constantRouterMap = [{
		path: '/user',
		component: UserLayout,
		redirect: '/user/login',
		hidden: true,
		children: [{
				path: 'login',
				name: 'login',
				component: () => import( /* webpackChunkName: "user" */ '@/views/user/Login')
			},
			{
				path: 'register',
				name: 'register',
				component: () => import( /* webpackChunkName: "user" */ '@/views/user/Register')
			},
			{
				path: 'register-result',
				name: 'registerResult',
				component: () => import( /* webpackChunkName: "user" */ '@/views/user/RegisterResult')
			},
			{
				path: 'recover',
				name: 'recover',
				component: undefined
			}
		]
	},

	{
		path: '/404',
		component: () => import( /* webpackChunkName: "fail" */ '@/views/exception/404')
	}
]